package com.springboot.demo.entity;

import com.springboot.demo.entity.validate.DeleteComponentGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * @author wubc683
 * @desc
 * @date 2021-11-23 14:45
 */
@Data
public class PanelComponent {
    @ApiModelProperty(value = "组件类型,0:报表，1:地图，2:地图关联组件", required = true)
    @NotNull(message = "组件类型不能为null",groups = DeleteComponentGroup.class)
    private Integer componentType;
    @ApiModelProperty(value = "组件id,例如：组件类型是报表，则为报表id,注意：地图和地图关联组件类型不需要此id,因为一个仪表盘最多只有一个地图及关联组件"
            , required = true)
    @NotNull(message = "组件id不能为null",groups = DeleteComponentGroup.class)
    private Long componentId;
    @ApiModelProperty(value = "组件所属仪表盘类型，0：运营仪表盘，1：场景仪表盘", required = true)
    @NotNull(message = "仪表盘类型不能为null")
    private Integer panelType;
    @ApiModelProperty(value = "组件所属仪表盘对象", required = true)
    @NotNull(message = "仪表盘id不能为null",groups = DeleteComponentGroup.class)
    private Long panelId;
    @ApiModelProperty(value = "组件位置信息", required = true)
    @NotNull(message = "组件位置不能为null")
    @Valid
    private ComponentPosition position;
}
